function PlotAndSave(x,y,Xtext,Ytext,isSEMILOGX,hasGRID,PathName,color)
   fig = figure(50);
   set(fig,'Visible','off');
   if(isSEMILOGX)
    semilogx(x,y,'LineWidth',2,'color',color);
   else
    plot(x,y,'LineWidth',2,'color',color);
   end
   axis([x(1,1) x(1,end) get(gca,'YLim')]);
   xlabel(Xtext);
   ylabel(Ytext);
   if(hasGRID)
    grid on;
   end
   
   saveas(fig,PathName);
   close(figure(50));
end